<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
</head>
<body>
 <a href="index2.html" target="_blank">打开另一个页面</a> |
<script type="text/javascript">
//在一个页面上，触发事件，引发以下代码执行
//创建一个名字是mychannel的对象。记住这个名字，下面会用到
let cast = new BroadcastChannel('mychannel'); 
myObj = { from: "children1", content: "add" };
cast.postMessage(myObj);

    </script>

    
</body>
</html>


